package com.seeqool.v1;

import java.util.Hashtable;

import javax.swing.ImageIcon;

public class ImageLibrary {
	private static Hashtable<String, ImageIcon> images = new Hashtable<String, ImageIcon>();
	
	public static ImageIcon get(String URL) {
		if (!images.containsKey(URL)) {
		    java.net.URL imgURL = ImageLibrary.class.getResource("images/"+URL);
		    if (imgURL != null) {
		        images.put(URL, new ImageIcon(imgURL, ""));
		    } else {
		        System.err.println("Couldn't find file: " + URL);
		        return null;
		    }
		}
		return images.get(URL);
	}
}
